package cn.com.bdqn.dao;

import cn.com.bdqn.entity.CstLinkman;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CstLinkmanDao {

    @Insert("insert into cst_linkman values\n" +
            "(default,#{lkmCustNo},#{lkmName},#{lkmSex},#{lkmPosition},#{lkmTel},#{lkmMobile},#{lkmMemo});")
    public int addCstLinkman(CstLinkman cstLinkman);

    @Delete("delete from cst_linkman where lkm_id = #{value};")
    public int delCstLinkman(Long lkmId);

    @Select("select * from cst_linkman where lkm_cust_no = #{value};")
    public List<CstLinkman> queryByLkmCustNo(String lkmCustNo);

    public int updateCstLinkman(CstLinkman cstLinkman);

    @Select("select * from cst_linkman where lkm_id = #{value};")
    public CstLinkman queryByLkmId(Long lkmId);
}
